package aybolit.core.objects.model;
// Generated 27.02.2013 9:15:35 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Departments generated by hbm2java
 */
@Entity
@Table(name="departments"
    ,catalog="aybolit"
)
public class Departments  implements java.io.Serializable {


     private Integer departmentId;
     private Hospitales hospitales;
     private Status status;
     private String name;
     private String note;
     private Date timestamp;
     private Set<Patientes> patienteses = new HashSet<Patientes>(0);
     private Set<Operators> operatorses = new HashSet<Operators>(0);

    public Departments() {
    }

    public Departments(Hospitales hospitales, Status status, String name, String note, Date timestamp, Set<Patientes> patienteses, Set<Operators> operatorses) {
       this.hospitales = hospitales;
       this.status = status;
       this.name = name;
       this.note = note;
       this.timestamp = timestamp;
       this.patienteses = patienteses;
       this.operatorses = operatorses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="department_id", unique=true, nullable=false)
    public Integer getDepartmentId() {
        return this.departmentId;
    }
    
    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="hospital_id")
    public Hospitales getHospitales() {
        return this.hospitales;
    }
    
    public void setHospitales(Hospitales hospitales) {
        this.hospitales = hospitales;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="departament_status")
    public Status getStatus() {
        return this.status;
    }
    
    public void setStatus(Status status) {
        this.status = status;
    }
    
    @Column(name="name", length=2000)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="note", length=2000)
    public String getNote() {
        return this.note;
    }
    
    public void setNote(String note) {
        this.note = note;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="timestamp_", length=19)
    public Date getTimestamp() {
        return this.timestamp;
    }
    
    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="departments")
    public Set<Patientes> getPatienteses() {
        return this.patienteses;
    }
    
    public void setPatienteses(Set<Patientes> patienteses) {
        this.patienteses = patienteses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="departments")
    public Set<Operators> getOperatorses() {
        return this.operatorses;
    }
    
    public void setOperatorses(Set<Operators> operatorses) {
        this.operatorses = operatorses;
    }




}


